<script type="text/javascript">
//var DiaAjax = new Object();
//DiaAjax.isUpdating = true;

DiaAjax={
    isUpdating : true,

    Request : function(method, url, query, callback)
    {
            this.isUpdating = true;
            this.callbackMethod = callback;
            this.request = (window.XMLHttpRequest)? new XMLHttpRequest(): new ActiveXObject("MSXML2.XMLHTTP");
            this.request.onreadystatechange = function() { DiaAjax.checkReadyState(); };

            if(method.toLowerCase() == 'get') url = url+"?"+query;
            this.request.open(method, url, true);
            this.request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            this.request.send(query); 
    },

    checkReadyState : function(_id)
    {
            switch(this.request.readyState)
            {
                    case 1: break;
                    case 2: break;
                    case 3: break;
                    case 4:
                            this.isUpdating = false; 
                            this.callbackMethod(this.request.responseXML.documentElement);
                            
            }
    }
};
</script>